package gameUi.panel
{
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.text.TextField;

	public class BupChipUI extends BupChipPanel
	{
		public function BupChipUI()
		{
			buChipUiInit();
			addLisitener();
		}
		
		private function buChipUiInit():void{
			for(var i:int = 0;i<6;i++){
				(this["txt"+i] as TextField).mouseEnabled = false;
			}
			txt0.text = "10";
			txt1.text = "50";
			txt2.text = "100";
			txt3.text = "300";
			txt4.text = "500";
			txt5.text = "1000";
		}
		
		private function addLisitener():void{
			cmdClose.addEventListener(MouseEvent.CLICK,onClickCmdClose);
			
			cmdBuy0.addEventListener(MouseEvent.CLICK,onClick0);
			cmdBuy1.addEventListener(MouseEvent.CLICK,onClick1);
			cmdBuy2.addEventListener(MouseEvent.CLICK,onClick2);
			cmdBuy3.addEventListener(MouseEvent.CLICK,onClick3);
			cmdBuy4.addEventListener(MouseEvent.CLICK,onClick4);
			cmdBuy5.addEventListener(MouseEvent.CLICK,onClick5);
		}
		
		private function onClick0(e:Event):void{
			BuyChipSurePanel.getInstance().showInfo(10);
		}
		
		private function onClick1(e:Event):void{
			BuyChipSurePanel.getInstance().showInfo(50);
		}
		
		private function onClick2(e:Event):void{
			BuyChipSurePanel.getInstance().showInfo(100);
		}
		
		private function onClick3(e:Event):void{
			BuyChipSurePanel.getInstance().showInfo(300);
		}
		
		private function onClick4(e:Event):void{
			BuyChipSurePanel.getInstance().showInfo(500);
		}
		
		private function onClick5(e:Event):void{
			BuyChipSurePanel.getInstance().showInfo(1000);
		}
		
		//关闭
		private function onClickCmdClose(e:Event):void{
			if(this.parent) this.parent.removeChild(this);
		}
	}
}